package com.softserveinc.interactive_board.commons;

import java.util.ArrayList;
import java.util.List;

import com.softserveinc.interactive_board.domain.User;

public class CheckedUsersList {
	
	List<CheckedUserContainer> list = new ArrayList<CheckedUserContainer>();
	
	public List<User> getCheckedUsers() {
		List<User> buff = new ArrayList<User>();
		for (CheckedUserContainer i : this.list)
			if (i.isChecked())
				buff.add(i.getUser());
		return buff;
	}
	
	public CheckedUsersList(List<User> list) {
		for (User u : list)
			this.list.add(new CheckedUserContainer(u, false));
	}
	
	public CheckedUsersList() {
		this.list = new ArrayList<CheckedUserContainer>();
	}

	public List<CheckedUserContainer> getList() {
		return list;
	}

	public void setList(List<CheckedUserContainer> list) {
		this.list = list;
	}

}
